package com.ymatou.query.seller.trading.api.parameter.info;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.List;

import net.sf.json.JSONObject;

import com.ymatou.iapi.trading.sellerquery2.parameter.resp.SubProductInfo;

public class OrderProductInfo extends SimpleProductInfo {

	/**
	 * 商品名称
	 */
	private String name;

	/**
	 * 商品分类[0]:一级,[1]:二级,[2]:三级.Categories.Length>=3.
	 */
	private List<Integer> categories;

	/**
	 * SKU
	 */
	private String sku;

	/**
	 * 单价(成交价)
	 */
	private BigDecimal price;

	/**
	 * 数量
	 */
	private int count;

	/**
	 * 总价=单价*数量
	 */
	private BigDecimal totalPrice;

	/**
	 * 商品规格
	 */
	private String propertyInfo;

	/**
	 * 保税区
	 */
	private int bondedArea;

	/**
	 * 配送方式
	 */
	private int logistics;

	/**
	 * 原价
	 */
	private BigDecimal originalPrice;

	/**
	 * 商品分摊运费
	 */
	private BigDecimal partialFreight;

	/**
	 * 免邮
	 */
	private boolean freightFree;

	/**
	 * 商品分摊的平台优惠金额
	 */
	private BigDecimal partialYmtCoupon;

	/**
	 * 分摊卖家优惠券
	 */
	private BigDecimal partialSellerCoupon;

	/**
	 * 分摊折扣
	 */
	private BigDecimal partialDiscount;

	/**
	 * 分摊的商家优惠金额
	 */
	private BigDecimal partialSellerPromotion;

	/**
	 * 分摊的平台优惠金额
	 */
	private BigDecimal partialYmtPromotion;

	/**
	 * 退货退款信息
	 */
	private OrderProductRefundInfo refundInfo;

	/**
	 * 品牌ID
	 */
	private int brandId;

	/**
	 * 规格ID
	 */
	private String catalogId;

	/**
	 * 商品ID
	 */
	private String productId;

	/**
	 * 商品类型
	 */
	private int catalogType;

	/**
	 * 套餐编号
	 */
	private String packageNo;

	/**
	 * 活动ID
	 */
	private int activityId;

	/**
	 * 是否预售商品
	 */
	private boolean preSale;

	/**
	 * 第三方折扣金额
	 */
	private BigDecimal thirdPartyDiscount;

	/**
	 * 是否PSP商品
	 */
	private boolean pspProduct;

	/**
	 * 单个商品定金金额
	 */
	private BigDecimal earnestAmount;

	/**
	 * 单个商品预售优惠金额(定金立减)
	 */
	private BigDecimal bookingPromotionAmount;

	/**
	 * 组合商品
	 */
	private List<SubProductInfo> subProductInfos;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Integer> getCategories() {
		return categories;
	}

	public void setCategories(List<Integer> categories) {
		this.categories = categories;
	}

	public String getSku() {
		return sku;
	}

	public void setSku(String sku) {
		this.sku = sku;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public BigDecimal getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	public String getPropertyInfo() {
		return propertyInfo;
	}

	public void setPropertyInfo(String propertyInfo) {
		this.propertyInfo = propertyInfo;
	}

	public int getBondedArea() {
		return bondedArea;
	}

	public void setBondedArea(int bondedArea) {
		this.bondedArea = bondedArea;
	}

	public int getLogistics() {
		return logistics;
	}

	public void setLogistics(int logistics) {
		this.logistics = logistics;
	}

	public BigDecimal getOriginalPrice() {
		return originalPrice;
	}

	public void setOriginalPrice(BigDecimal originalPrice) {
		this.originalPrice = originalPrice;
	}

	public BigDecimal getPartialFreight() {
		return partialFreight;
	}

	public void setPartialFreight(BigDecimal partialFreight) {
		this.partialFreight = partialFreight;
	}

	public boolean isFreightFree() {
		return freightFree;
	}

	public void setFreightFree(boolean freightFree) {
		this.freightFree = freightFree;
	}

	public BigDecimal getPartialYmtCoupon() {
		return partialYmtCoupon;
	}

	public void setPartialYmtCoupon(BigDecimal partialYmtCoupon) {
		this.partialYmtCoupon = partialYmtCoupon;
	}

	public BigDecimal getPartialSellerCoupon() {
		return partialSellerCoupon;
	}

	public void setPartialSellerCoupon(BigDecimal partialSellerCoupon) {
		this.partialSellerCoupon = partialSellerCoupon;
	}

	public BigDecimal getPartialDiscount() {
		return partialDiscount;
	}

	public void setPartialDiscount(BigDecimal partialDiscount) {
		this.partialDiscount = partialDiscount;
	}

	public BigDecimal getPartialSellerPromotion() {
		return partialSellerPromotion;
	}

	public void setPartialSellerPromotion(BigDecimal partialSellerPromotion) {
		this.partialSellerPromotion = partialSellerPromotion;
	}

	public BigDecimal getPartialYmtPromotion() {
		return partialYmtPromotion;
	}

	public void setPartialYmtPromotion(BigDecimal partialYmtPromotion) {
		this.partialYmtPromotion = partialYmtPromotion;
	}

	public OrderProductRefundInfo getRefundInfo() {
		return refundInfo;
	}

	public void setRefundInfo(OrderProductRefundInfo refundInfo) {
		this.refundInfo = refundInfo;
	}

	public int getBrandId() {
		return brandId;
	}

	public void setBrandId(int brandId) {
		this.brandId = brandId;
	}

	public String getCatalogId() {
		return catalogId;
	}

	public void setCatalogId(String catalogId) {
		this.catalogId = catalogId;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	public int getCatalogType() {
		return catalogType;
	}

	public void setCatalogType(int catalogType) {
		this.catalogType = catalogType;
	}

	public String getPackageNo() {
		return packageNo;
	}

	public void setPackageNo(String packageNo) {
		this.packageNo = packageNo;
	}

	public int getActivityId() {
		return activityId;
	}

	public void setActivityId(int activityId) {
		this.activityId = activityId;
	}

	public boolean isPreSale() {
		return preSale;
	}

	public void setPreSale(boolean preSale) {
		this.preSale = preSale;
	}

	public BigDecimal getThirdPartyDiscount() {
		return thirdPartyDiscount;
	}

	public void setThirdPartyDiscount(BigDecimal thirdPartyDiscount) {
		this.thirdPartyDiscount = thirdPartyDiscount;
	}

	public boolean isPspProduct() {
		return pspProduct;
	}

	public void setPspProduct(boolean pspProduct) {
		this.pspProduct = pspProduct;
	}

	public BigDecimal getEarnestAmount() {
		return earnestAmount;
	}

	public void setEarnestAmount(BigDecimal earnestAmount) {
		this.earnestAmount = earnestAmount;
	}

	public BigDecimal getBookingPromotionAmount() {
		return bookingPromotionAmount;
	}

	public void setBookingPromotionAmount(BigDecimal bookingPromotionAmount) {
		this.bookingPromotionAmount = bookingPromotionAmount;
	}

	public boolean equals(OrderProductInfo o1) {
		return o1.toString().equals(this.toString());
	}

	public String toString() {
		return JSONObject.fromObject(this).toString();
	}

	public List<SubProductInfo> getSubProductInfos() {
		return subProductInfos;
	}

	public void setSubProductInfos(List<SubProductInfo> subProductInfos) {
		this.subProductInfos = subProductInfos;
	}

	@SuppressWarnings("rawtypes")
	public static void main(String[] args) {
		Class c = OrderProductInfo.class;
		for (Field f : c.getDeclaredFields()) {
			String s = f.getName();
			System.out
					.println("DataUtil.verifyEquals(expect.get"
							+ s
							+ "(), actual.get"
							+ s
							+ "(), \"验证id=[\" + expectId+ \"]的ProductId=[\"+pid+\"]的Product."
							+ s + "\");");
		}
		OrderProductInfo o1 = new OrderProductInfo();
		OrderProductInfo o2 = new OrderProductInfo();
		System.out.println(o1.equals(o2));
	}

}
